<template>
    <div>
        <el-dialog title="角色列表" v-model="dialogSysRoleMenu" width="70%" >
            <el-table
                    :data="tableData"
                    style="width: 100%">
                <el-table-column
                        label="角色名称"
                        prop="name">
                </el-table-column>
                <el-table-column
                        label="URL"
                        prop="url">
                </el-table-column>
                <el-table-column
                        label="编码"
                        prop="code">
                </el-table-column>
                <el-table-column
                        label="图标"
                        prop="pic">
                </el-table-column>
                <el-table-column
                        label="上级菜单"
                        prop="parentName">
                </el-table-column>
            </el-table>
        </el-dialog>
    </div>

</template>

<script>

    import {postReq} from "../../../utils/api";

    export default {
        name: "SysRoleMenu",
        components:{},
        mounted() {
        },
        data(){
            return{
                tableData:[],
                dialogSysRoleMenu:false,
                formObj:{
                    roleId:undefined
                }
            }
        },
        methods:{
            open(id){
                this.formObj.roleId = id
                this.dialogSysRoleMenu = true
                this.getMenuRelRole(id)
            },
            getMenuRelRole(){
                postReq('/api/sys_resource/list_role_menu',this.formObj).then(res=>{
                    this.tableData = res.data.data
                })
            },
        }
    }
</script>

<style scoped>

</style>